﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting

<TestClass()> Public Class FeaturesTest
    Inherits TestBase

    <TestMethod()> Public Sub RegisteredFeature_IsSaved()
        Initialize()
        Features.Register(Of FakeFeature)(New FakeFeature())
        Features.Save()
        Assert.IsTrue(Repository.SavedFeatures().Count = 1)
    End Sub

	<TestMethod> Public Sub FeatureExistsReturnsTrueIfRegistered()
		Initialize()
		Features.Register(Of FakeFeature)(New FakeFeature())
		Assert.IsTrue(Features.Exists(Of FakeFeature))
	End Sub

	<TestMethod> Public Sub FeatureNotAddedIfYetAdded()
		Initialize()
		Features.Register(Of FakeFeature)(New FakeFeature() With {.IsEnabled = False})
		Features.RegisterIfNotExists(Of FakeFeature)(New FakeFeature() With {.IsEnabled = True})
		Assert.IsFalse(Features.IsEnabled(Of FakeFeature)())
	End Sub

End Class